import { Controller, Post, Get, Body, Query } from '@nestjs/common';
import { ArticleCommentService } from './article-comment.service';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('评论模块')
@Controller('article-comment')
export class ArticleCommentController {
  constructor(private readonly commentService: ArticleCommentService) {}

  @Post('add')
  async addComment(@Body() body: any) {
    return this.commentService.addComment(body);
  }

  @Get('list')
  async getComments(@Query('articleId') articleId: number) {
    return this.commentService.getCommentsByArticle(articleId);
  }
}
